//
//  YYTransition.m
//  LearnObjectiveC
//
//  Created by client on 2017/9/18.
//  Copyright © 2017年 吴可高. All rights reserved.
//

#import "YYTransition.h"

@implementation YYTransition
+(id)transitionFrom:(NSString*)from to:(NSString*)to;
{
    return [[self alloc]initFrom:from to:to];
}
-(id)initFrom:(NSString*)from to:(NSString*)to;
{
    self = [super init];
    if (self) {
        _from = [from copy];
        _to = [to copy];
    }
    return self;
}

-(BOOL)isEqual:(id)object
{
    if (self == object) {
        return YES;
    }
    if (![self isKindOfClass:[object class]]) {
        return NO;
    }
    YYTransition * other = (YYTransition*)object;
    if (![self.from isEqualToString:other.from]) {
        return NO;
    }
    if (![self.to isEqual:other.to]) {
        return NO;
    }
    return YES;
}

- (NSUInteger) hash {
    NSUInteger result = 17;
    result = 31 * result + self.from.hash;
    result = 31 * result + self.to.hash;
    return result;
}


@end
